﻿using FanaticRock.Database.Common;
using LiteDB;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FanaticRock.Database.LiteDb.Warp
{
    public class LiteDbCollectionDbSet<T> : ILocalDbSet<T>, IDisposable
    {
        private ILiteCollection<T> _coll;

        public LiteDbCollectionDbSet(ILiteCollection<T> coll)
        {
            _coll = coll;
        }

        //public T FindById(string id)
        //{

        //    return _coll.FindById(id);
        //}

        public IEnumerable<T> C()
        {
            return _coll.Query().ToEnumerable();
        }

        public void Dispose()
        {
            _coll = null;

        }
    }
}
